import Vue from 'vue';
import App from './App.vue';
import Vant from 'vant';
import VueRouter from 'vue-router';
import routes from '@/router';
import 'vant/lib/index.css';
import { Icon } from 'vant';
import { Field } from 'vant';
import { Tabbar, TabbarItem } from 'vant';
import moment from 'moment';
import { NavBar } from 'vant';
import { List } from 'vant';
import { Tab, Tabs } from 'vant';
import Vuex from 'vuex';
import storeConfig from '@/store';
import { Search } from 'vant';

import navBar from '@/components/nav-bar';
import ArticleList from '@/components/article-list'

import { Loading } from 'vant';

Vue.use(Loading);


Vue.component('NavBar', navBar);
Vue.component('ArticleList', ArticleList);
// 搜索框
Vue.use(Search);
// vuex
Vue.use(Vuex)
// 标签页
Vue.use(Tab);
Vue.use(Tabs);
// 列表
Vue.use(List);
// 顶部导航栏
Vue.use(NavBar);

// 全局设置moment
moment.locale('zh-cn')
// console.log(moment(1658482134742).fromNow());
// 底部导航栏
Vue.use(Tabbar);
Vue.use(TabbarItem);
// 输入框
Vue.use(Field);
// 图标
Vue.use(Icon);
// 路由
Vue.use(VueRouter)
// 全局注册
Vue.use(Vant);
Vue.config.productionTip = false

new Vue({
  router: new VueRouter({
    routes
  }),
  // 挂载store
  store: new Vuex.Store(storeConfig),
  render: h => h(App),
}).$mount('#app')
